import { createStore } from "vuex";

const store = createStore({
    state() {
        return {
            user:JSON.parse(localStorage.getItem("user")),
            isCollapse: false
        }
    },
    mutations: {
        updateIsCollapse(state) {
            state.isCollapse = !state.isCollapse
        },
        saveUser(state,value){
            state.user = value
        }
    },
    getters:{
        getUser(state){
            return state.user;
        }
    }
})

export default store